use chrono::NaiveDateTime;
use serde::{Deserialize, Serialize};

#[derive(Queryable, Serialize)]
#[diesel(table_name = crate::schema::todo)]
pub struct Todo {
  pub id: i32,
  pub name: String,
  pub email: String,
  pub created_at: NaiveDateTime,
}

#[derive(Insertable, Deserialize)]
#[diesel(table_name = crate::schema::todo)]
pub struct NewTodo {
  pub name: String,
  pub email: String,
}

#[derive(Queryable, Deserialize)]
pub struct UpdateTodo {
  pub name: String,
  pub email: String,
  // #[serde(skip_deserializing)]
  // pub create_at: NaiveDateTime,
}
